//
//  QZPositionVc.m
//  WeiWeiHaircut
//
//  Created by 上官惠阳 on 15/12/17.
//  Copyright © 2015年 超群. All rights reserved.
//

#import "QZPositionVc.h"
#import "QZServiceItemsCell.h"

@interface QZPositionVc ()

@end

@implementation QZPositionVc
{
    NSString *_seletedContent;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self titleWithSting:@"服务方式"];
    
    [self addBtnOnNavWithTitle:@"预约" andImageName:@"返回" andTarget:self andAction:@selector(backAction) andFrame:CGRectMake(0, 0, 45, 20) andDirection:left];
    
//    [self addBtnOnNavWithTitle:@"确定" andImageName:nil andTarget:self andAction:@selector(sureService) andFrame:CGRectMake(0, 0, 40, 20) andDirection:right];
    
    [self createTableViewWithPlainStyle:NO andSeparatorStyleNone:NO andBackGroudImageName:nil];
    [self registCellWithNib:@"QZServiceItemsCell" addIdentifier:@"itemCell" addHeight:40];
    [self loadData];
}
-(void)loadData
{
    [self.tableSource addObject:@[@"店铺",@"上门服务"]];
    if (_lastSeletedContent) {
        _seletedContent = _lastSeletedContent;
    }
    
    [self.tableView reloadData];
}
//确定
-(void)sureService
{

}
-(void)loadCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
    QZServiceItemsCell *itemCell = (QZServiceItemsCell *)cell;
    itemCell.textLabel.text = self.tableSource[indexPath.section][indexPath.row];
    if ([itemCell.textLabel.text isEqualToString:_seletedContent]) {
        itemCell.seleteBtn.selected = YES;
    }else{
        itemCell.seleteBtn.selected = NO;
    }
}
-(void)actionAtIndexPath:(NSIndexPath *)indexPath
{
    _seletedContent = self.tableSource[indexPath.section][indexPath.row];
    
    if (self.seletedBlock) {
        self.seletedBlock(_seletedContent);
    }
    [self.navigationController popViewControllerAnimated:YES];
  
}
-(void)backAction
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
